<script>
var $j = jQuery.noConflict();
$j(document).ready(function(){
	var options={
	target:'#formrecuperar',
	beforeSubmit: function(formData, jqForm,options)
	{
		if($j('#UserUsername').val()=="")
		{
			alert("Debe Ingresar Su nombre de Usuario");
			$j('#UserUsername').focus();
			return false;
		}
	},
	success: function(responseText, statusText, xhr, $jform)
	{$j("#formrecuperar").show();}	
	}
	$j('#recuperarForm').ajaxForm(options);
	
	$j("#botonrecuperar").click(function(){
            $j("#spinner").show();
            $j("#formrecuperar").hide();
          });
          
          $j("#spinner").bind("ajaxSend", function() {
                  $j(this).show();
          }).bind("ajaxStop", function() {
                  $j(this).hide();
          }).bind("ajaxError", function() {
                  $j(this).hide();
          });
})
</script>
<div id="recuperar" class="loginuser">
<div id="spinner" class="spinner" style="display:none;">
	Por Favor Espere.... </br></br>
	<img id="img-spinner" src="img/spinner.gif" alt="Loading"/>
</div>
<!--div id="formrecuperar" class="formenviar"-->
<div id="formrecuperar" class="formrecuperar">
<?php
		if (isset($closeModalbox) && $closeModalbox) echo "<div id='closeModalbox'></div>";
		
		if ($ajax->isAjax()) 
		{
		// show ajax form
			echo $ajax->form('recuperar', 'user', array(
				'model'    => 'User',
				'url'      => array('controller' => 'users', 'action' => 'recuperar'),
				'update'   => 'MB_content',
				'id'	=>	'recuperarForm'
				));
		} 
		else 
		{
			echo $form->create('User',array('action'=>'recuperar','id'=>'recuperarform'));
		}
?>
<?php 
	echo $form->create('User',array('controller'=>'users','action'=>'recuperar'));
	echo '<div id="textologinclave" class="textologinclave">';
	echo $session->read('recup');
	echo "</div>";
	echo "</br>"
?>	
		<?php
			echo '<div id="textologinclave" class="textologinclave">';
			echo "C&eacute;dula";
			echo "</div>";
			echo $form->input('User.username',array('label'=>'','class'=>'entrada16','onfocus'=>'clearText(this)','onblur'=>'clearText(this)'));
			echo '<div id="textologinclave" class="textologinclave">';
			echo "E-mail";
			echo "</div>";
			echo $form->input('Cliente.mail',array('label'=>'','class'=>'entrada16','onfocus'=>'clearText(this)','onblur'=>'clearText(this)'));
			echo $form->button('  Enviar  ', array('type'=>'submit','class'=> 'botoncorreo2','id'=>'botonrecuperar'));
			echo $form->end();
		?>
</div>
</div>
	



